package com.ufo.web;

import jdk.nashorn.internal.runtime.URIUtils;

public class MyUriUtil {
    public static void main(String[] args){

    }

    //将所有的//转成/
    public static String getSanitizedPath(final String path) {
        int index = path.indexOf("//");
        if (index >= 0) {
            StringBuilder sanitized = new StringBuilder(path);
            while (index != -1) {
                sanitized.deleteCharAt(index);
                index = sanitized.indexOf("//", index);
            }
            return sanitized.toString();
        }
        return path.toString();
    }
}
